Objektorientiertes PHP5 (Band 2): MySQL und Doctrine 2 (Praxisorientiert PHP lernen 3) (German Edition) by Jan Teriete

Objektorientiertes PHP5 (Band 2): MySQL und Doctrine 2 (Praxisorientiert PHP lernen 3) (German Edition) by Jan Teriete

Author:Jan Teriete [Teriete, Jan]
Language: deu
Format: epub
Publisher: Webmasters Press
Published: 2017-01-16T23:00:00+00:00


12.3.1 Browse

Beispiel

1<?php 2 3namespace Controllers; 4 5use Entities\Article; 6 7class IndexController extends AbstractBase 8{ 9 public function indexAction() 10 { 11 $em = $this->getEntityManager(); 12 $query = $em 13 ->createQueryBuilder() 14 ->select('a, t, u') 15 ->from('Entities\Article', 'a') 16 ->leftJoin('a.tags', 't') 17 ->leftJoin('a.user', 'u') 18 ->orderBy('a.createdAt', 'DESC') 19 ->getQuery() 20 ; 21 $articles = $query->getResult(); 22 23 $this->addContext('articles', $articles); 24 } 25}

src/Controllers/IndexController.php (Version 1)Codebeispiel 102 src/Controllers/IndexController.php (Version 1)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.